import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { FooDemoComponent } from './foo-demo.component';
import { DetailViewComponent } from './detail-view/detail-view.component';
import { MaterialTemplateDrivenFormComponent } from './material-template-driven-form/material-template-driven-form.component';
import { FloatInputReactiveFormComponent } from './float-input-reactive-form/float-input-reactive-form.component';
import { FloatInputTemplateDrivenFormComponent } from './float-input-template-driven-form/float-input-template-driven-form.component';

// Routing for lazy loading.
const routes: Routes = [
    {
        path: '',
        component: FooDemoComponent,
        children: [
            {
                path: 'detail-view',
                component: DetailViewComponent
            },
            {
                path: 'material-template-driven-form',
                component: MaterialTemplateDrivenFormComponent
            },
            {
                path: 'float-input-reactive-form',
                component: FloatInputReactiveFormComponent
            },
            {
                path: 'float-input-template-driven-form',
                component: FloatInputTemplateDrivenFormComponent
            }
        ]
    }    
];

@NgModule({
    // Always call RouterModule.forChild in a feature-routing module.
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class FooDemoRoutingModule { }